const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
  transpileDependencies: true,
  publicPath: "./",
  outputDir: "dist",
  assetsDir: "static",

  configureWebpack: (config) => {
    if (process.env.NODE_ENV === "development") {
      config.devtool = "source-map";
      config.optimization.minimize = false;
    } else {
      config.devtool = "hidden-source-map";
    }
  },
  devServer: {
    proxy: {
      "/api": {
        target: "http://192.168.41.113:8080/",
        changeOrigin: true,
        pathRewrite: {},
      },
      "/other-api": {
        target: "https://api.example.com",
        changeOrigin: true,
        pathRewrite: {
          "^/other-api": "",
        },
        secure: false,
      },
    },
  },
});
